<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table border="1" width="300">
        <tr>
            <th>年级编号</th>
            <th>年级名称</th>
        </tr>
        <tbody>
            <!--
            <tr>
                <td></td>
                <td></td>
            </tr>
            -->
        </tbody>
    </table>
    <script type="text/javascript" src="./node_modules/axios/dist/axios.js" ></script>
    <script type="text/javascript">
        window.onload=function(){
            axios.get("http://localhost:8888/grade/selectGrade")
            .then(function(res){
                let gradeInfo = res.data.gradeInfo;
                let fu = document.getElementsByTagName("tbody")[0];
                for(let item of gradeInfo){
                    let tr = document.createElement("tr");
                    tr.innerHTML=`<td>${item.gradeId}</td>
                                  <td>${item.gradeName}</td>`;
                    fu.appendChild(tr);
                }
            }).catch(function(err){
                console.log(err)
            });
        }
    </script>
</body>
</html>